/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entitybean;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Admin
 */
@Entity
@Table(name = "media_detail", catalog = "OnlineShopFourDVD", schema = "dbo")
@NamedQueries({
    @NamedQuery(name = "MediaDetail.findAll", query = "SELECT m FROM MediaDetail m"),
    @NamedQuery(name = "MediaDetail.findByDetailId", query = "SELECT m FROM MediaDetail m WHERE m.detailId = :detailId"),
    @NamedQuery(name = "MediaDetail.findByDetailName", query = "SELECT m FROM MediaDetail m WHERE m.detailName = :detailName"),
    @NamedQuery(name = "MediaDetail.findByMediaPath", query = "SELECT m FROM MediaDetail m WHERE m.mediaPath = :mediaPath"),
    @NamedQuery(name = "MediaDetail.findByIntroduction", query = "SELECT m FROM MediaDetail m WHERE m.introduction = :introduction")})
public class MediaDetail implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "detail_id", nullable = false)
    private Integer detailId;
    @Column(name = "detail_name", length = 50)
    private String detailName;
    @Column(name = "media_path", length = 100)
    private String mediaPath;
    @Column(name = "introduction", length = 1000)
    private String introduction;
    @JoinColumn(name = "media_id", referencedColumnName = "media_id", nullable = false)
    @ManyToOne(optional = false)
    private Media media;

    public MediaDetail() {
    }

    public MediaDetail(Integer detailId) {
        this.detailId = detailId;
    }

    public Integer getDetailId() {
        return detailId;
    }

    public void setDetailId(Integer detailId) {
        this.detailId = detailId;
    }

    public String getDetailName() {
        return detailName;
    }

    public void setDetailName(String detailName) {
        this.detailName = detailName;
    }

    public String getMediaPath() {
        return mediaPath;
    }

    public void setMediaPath(String mediaPath) {
        this.mediaPath = mediaPath;
    }

    public String getIntroduction() {
        return introduction;
    }

    public void setIntroduction(String introduction) {
        this.introduction = introduction;
    }

    public Media getMedia() {
        return media;
    }

    public void setMedia(Media media) {
        this.media = media;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (detailId != null ? detailId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof MediaDetail)) {
            return false;
        }
        MediaDetail other = (MediaDetail) object;
        if ((this.detailId == null && other.detailId != null) || (this.detailId != null && !this.detailId.equals(other.detailId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entitybean.MediaDetail[detailId=" + detailId + "]";
    }

}
